<div class="main-view"><!--最外层div-->
    <br><div class="left-margin top-margin"><strong class="am-text-primary am-text-lg">举报管理</strong></div>

    <form class="am-form-inline left-margin top-margin" role="form">

        <div class="city-cascading" style="display: inline-block;" id="cascad-search"></div>
        <label>处理状态:</label>
        <select data-am-selected="{btnSize: 'sm'}"  ng-model="reportStatus" style="margin-left: 0px;">
            <option value=-2>全部</option>
            <option value=0>未处理</option>
            <option value=1>已删除</option>
            <option value=-1>已忽略</option>
        </select>
        <!--宝宝树66小区二次改造    add   chenf  20170821   start-->
        <label>举报类型:</label>
        <select data-am-selected="{status: 'su'}" style="margin-left: 0px;" id="status">
            <option value=1 selected = "selected" >帖子</option>
            <option value=2>闲置</option>
        </select>
        <!--宝宝树66小区二次改造    add   chenf  20170821   end-->
        <button id="search-target" data-am-modal="{target: '#loading'}" type="submit" class="am-btn am-btn-primary left-margin" ng-click="searchReport()" data-target="cascad-search">搜索</button>

    </form>
    <br>

    <div id="pagination" class="pagination"></div>
    <div class="pagination-table left-margin" id="tab_menu" style = "margin-top: 0px;">
        <form class="am-form">
            <!--宝宝树66小区二次改造    add   chenf  20170821   start-->
            <input type="hidden" value="{{statusFlg}}" id="statusFlg">
            <div ng-if="statusFlg == 1">
            <!--宝宝树66小区二次改造    add   chenf  20170821   end-->
            <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <!--<th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>-->
                    <th class="table-title">所属小区</th>
                    <th class="table-title">问题描述</th>
                    <th class="table-title">问题创建者</th>
                    <th class="table-title">创建时间</th>
                    <th class="table-title">举报人ID</th>
                    <th class="table-title">举报人昵称</th>
                    <th class="table-title">举报人数</th>
                    <th class="table-title">状态</th>
                    <th class="table-title">操作</th>

                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="question in questionList"  id = "{{question.objId}}">
                    <!--<td class="table-check"><input type="checkbox" class = "item-check"></td>-->

                    <td>{{question.questionCommunity.communityName}}</td>
                    <td title="{{question.question.title}}" style="width: 400px;word-wrap:break-word;"><div style = "position: relative;width: 400px;line-height: 1.2;">{{question.question.desc}}</div></td>
                    <td><div>{{question.questionCreateBy.nickName}}</div></td>
                    <td><div>{{question.question.dateCreated | date:'yyyy-MM-dd'}}<br>{{question.question.dateCreated | date:'HH:mm:ss'}}</div></td>
                    <td>{{question.reportUser.objId}}</td>
                    <td>{{question.reportUser.nickName}}</td>
                    <td>{{question.count}}</td>
                    <td ng-show="question.reportStatus == -1">已忽略</td>
                    <td ng-show="question.reportStatus == 0">未处理</td>
                    <td ng-show="question.reportStatus == 1">已删除</td>
                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <button ng-show="question.reportStatus==0 || !question.reportStatus" data-am-modal="{target:'#delete-confirm-{{$index}}'}" class="am-btn am-btn-default am-btn-xs am-text-danger"><span class="am-icon-trash-o"></span> 删除</button>
                                <button ng-show="question.reportStatus==0 || !question.reportStatus" data-am-modal="{target:'#reject-confirm-{{$index}}'}" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 忽略</button>

                                <!--删除-->
                                <div class="am-modal am-modal-confirm" tabindex="-1" id="delete-confirm-{{$index}}">
                                    <div class="am-modal-dialog">
                                        <div class="am-modal-hd">{{question.community.communityName}}</div>
                                        <div class="am-modal-bd">
                                            确定要删除这条帖子吗？
                                        </div>
                                        <div class="am-modal-footer">
                                            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                                            <span ng-click="deleteQuestionReport(question, $index)" class="am-modal-btn" data-am-modal-confirm>确定</span>
                                        </div>
                                    </div>
                                </div>

                                <!--拒绝-->
                                <div class="am-modal am-modal-confirm" tabindex="-1" id="reject-confirm-{{$index}}">
                                    <div class="am-modal-dialog">
                                        <div class="am-modal-hd">{{question.community.communityName}}</div>
                                        <div class="am-modal-bd">
                                            是否忽略这条举报信息？
                                        </div>
                                        <div class="am-modal-footer">
                                            <span class="am-modal-btn" data-am-modal-cancel>否</span>
                                            <span ng-click="rejectQuestionReport(question, $index)" class="am-modal-btn" data-am-modal-confirm>是</span>
                                        </div>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </td>

                </tr>
                </tbody>
            </table>
            <!--宝宝树66小区二次改造    add   chenf  20170821   start   追加举报区分闲置和帖子-->
            </div>
            <div ng-if="statusFlg == 2">
            <table class="am-table am-table-striped am-table-hover table-main">
                <thead>
                <tr>
                    <!--<th class="table-check"><input type="checkbox" ng-click="allSelected()"></th>-->
                    <th class="table-title">所属小区</th>
                    <th class="table-title">问题描述</th>
                    <th class="table-title">问题创建者</th>
                    <th class="table-title">创建时间</th>
                    <th class="table-title">举报人ID</th>
                    <th class="table-title">举报人昵称</th>
                    <th class="table-title">举报人数</th>
                    <th class="table-title">状态</th>
                    <th class="table-title">操作</th>

                </tr>
                </thead>
            <tbody>
            <tr ng-repeat="goods in questionList"  id = "{{goods.objId}}">

                <td>{{goods.goodsCommunity.communityName}}</td>
                <td title="{{goods.goods.title}}" style="width: 400px;word-wrap:break-word;">
                    <div style = "position: relative;width: 300px;line-height: 1.2;float: left;">{{goods.goods.title}}<br>{{goods.goods.desc}}</div>
                    <div id="readPictureBtn" style="float: right;"><button type="button" class="am-btn am-btn-default am-btn-xs am-text-secondary " ng-show="true" ng-click="readPicture(goods.goods)">查看</button></div>
                </td>
                <td><div>{{goods.goodsCreateBy.nickName}}</div></td>
                <td><div>{{goods.goods.dateCreated | date:'yyyy-MM-dd'}}<br>{{goods.goods.dateCreated | date:'HH:mm:ss'}}</div></td>
                <td>{{goods.reportUser.objId}}</td>
                <td>{{goods.reportUser.nickName}}</td>
                <td>{{goods.count}}</td>
                <td ng-show="goods.reportStatus == -1">已忽略</td>
                <td ng-show="goods.reportStatus == 0">未处理</td>
                <td ng-show="goods.reportStatus == 1">已删除</td>
                <td>
                    <div class="am-btn-toolbar">
                        <div class="am-btn-group am-btn-group-xs">
                            <button ng-show="goods.reportStatus==0 || !goods.reportStatus" data-am-modal="{target:'#delete-confirm2-{{$index}}'}" class="am-btn am-btn-default am-btn-xs am-text-danger"><span class="am-icon-trash-o"></span> 删除</button>
                            <button ng-show="goods.reportStatus==0 || !goods.reportStatus" data-am-modal="{target:'#reject-confirm2-{{$index}}'}" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 忽略</button>

                            <!--删除-->
                            <div class="am-modal am-modal-confirm" tabindex="-1" id="delete-confirm2-{{$index}}">
                                <div class="am-modal-dialog">
                                    <div class="am-modal-hd">{{goods.community.communityName}}</div>
                                    <div class="am-modal-bd">
                                        确定要删除这条闲置吗？
                                    </div>
                                    <div class="am-modal-footer">
                                        <span class="am-modal-btn" data-am-modal-cancel>取消</span>
                                        <span ng-click="deleteQuestionReport(goods, $index)" class="am-modal-btn" data-am-modal-confirm>确定</span>
                                    </div>
                                </div>
                            </div>

                            <!--拒绝-->
                            <div class="am-modal am-modal-confirm" tabindex="-1" id="reject-confirm2-{{$index}}">
                                <div class="am-modal-dialog">
                                    <div class="am-modal-hd">{{question.community.communityName}}</div>
                                    <div class="am-modal-bd">
                                        是否忽略这条举报信息？
                                    </div>
                                    <div class="am-modal-footer">
                                        <span class="am-modal-btn" data-am-modal-cancel>否</span>
                                        <span ng-click="rejectQuestionReport(goods, $index)" class="am-modal-btn" data-am-modal-confirm>是</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            </tbody>
            </table>
             </div>
            <!--宝宝树66小区二次改造    add   chenf  20170821   end   追加举报区分闲置和帖子-->
        </form>
    </div>

    <!--宝宝树66小区二次改造    add   chenf  20170821   start   追加查看图片-->
    <div class="am-modal am-modal-no-btn" id="images">
        <div class="am-modal-dialog">
            <div class="am-modal-hd border-bottom" style = "text-align: left;">闲置图片查看
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class="am-modal-bd body-area">
                <div style = "width:80%" class = "text-left">
                    <div ng-repeat="images in imagsList">
                        <div>
                        <slide>
                            <img ng-src="{{images.imageURL}}" style="width: 150px;" onclick="if($(this).width()==100){
                                                    $('img').width(150);
                                                    $(this).width(320);
                                                    }else{
                                                    $(this).width(100);
                                                    };">
                        </slide>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--宝宝树66小区二次改造    add   chenf  20170821   end   追加查看图片-->
    <div class = "left-margin">共<span id = 'page_number'>{{pageNumber}}</span>页 <span>{{count}}条数据</span></div>

</div>





<script>$(function ()
{ $("[data-toggle='popover']").popover();
});
</script>

<script>
    Date.prototype.format = function (format) {
        var o = {
            "M+": this.getMonth() + 1, //month
            "d+": this.getDate(), //day
            "h+": this.getHours(), //hour
            "m+": this.getMinutes(), //minute
            "s+": this.getSeconds(), //second
            "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
            "S": this.getMilliseconds() //millisecond
        }
        if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
                (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o) if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
                    RegExp.$1.length == 1 ? o[k] :
                            ("00" + o[k]).substr(("" + o[k]).length));
        return format;
    }

    var fromDate = $('#startDate').datepicker().on('changeDate', function (ev) {
        //alert(ev.date.format('yyyy-MM-dd'));
        //$scope.startDate=ev.date.format('yyyy-MM-dd');
        $("#startDate").val(ev.date.format('yyyy-MM-dd'));
//        alert(ev.date);
    });

    var toDate = $('#endDate').datepicker().on('changeDate', function (ev) {
        // alert(ev.date.format('yyyy-MM-dd'));
        //$scope.endDate=ev.date.format('yyyy-MM-dd');
        $("#endDate").val(ev.date.format('yyyy-MM-dd'));
    });

    var hideContent = function(obj){
        $("#display_hide_content").css("display","block");
        $("#display_hide_content1").text(obj.innerText);
        $("#display_hide_content")[0].style.left = obj.offsetLeft + "px";
        $("#display_hide_content")[0].style.top = 60 + obj.offsetTop + "px";
    };

    $("#display_hide_close").on("click",function(){
        $("#display_hide_content").css("display","none");
    });

</script>